import com.slothought.rowgazer.*

def paramTest = { def mapper, def params, def em ->

    try {  mapper.mapParams(params)  ; "ok"}
    catch(Exception e){
      e.getMessage()  
    }
}

def mapper = new GazerRequestParamsMapper()
Map params 
String errmsg = ""



params = ['d13.v0':'1235', 'd13.v1':'1235',  'd115.v0':'1235', 'd115.v1':'1235', '1234':'d123.v3', 'c0':'field', 'c1':'field']
errmsg = null
assert paramTest( mapper, params, errmsg) == "ok"

params = ['d13.v0':'1235', 'd13.v1':'1235',  'd115.v0':'1235', 'd115.v2':'1235', 'd115.v1':'1235','1234':'d123.v3', 'c0':'field', 'c1':'field']
errmsg = null
assert paramTest( mapper, params, errmsg) == "filter value indexes not in the form of [0..n]"

params = ['d13.v0':'1235', 'd13.v1':'1235',  'd115.v0':'1235', 'd115.v1':'1235', 'd115.v':'1235','1234':'d123.v3', 'c0':'field', 'c1':'field']
errmsg = null
assert paramTest( mapper, params, errmsg) == "ok"

params = ['d13.v4':'1235', 'd115.v3':'1235', '1234':'d123.v3', 'c0':'sfja']
errmsg = null
assert paramTest( mapper, params, errmsg) == "filter value indexes not in the form of [0..n]"
params = ['d13.v0':'1235', 'd13.v1':'1235',  'd115.v0':'1235', 'd115.v1':'1235', '1234':'d123.v3', 'c1':'field']
errmsg = null
assert paramTest( mapper, params, errmsg) == "column indexes not in the form or [0..n]"
//println GazerException.class.constructors

//println x.getClass()

//Exception.class.methods.each{println it}